﻿

CREATE PROCEDURE [dbo].[proc_Project_Task_GetItem]
	(
		@TaskId uniqueidentifier
	)
AS
Begin
	Select Id,
		FId,
		TaskId,
		OrderId,
		ProjectId,
		ProjectName,
		CusName,
		Title,
		WebType,
		Description,
		DownPerson,
		DownPersonName,
		ExecDepartmentId,
		ExecDepartmentName,
		ExecPerson,
		ExecPersonName,
		StartDate,
		IsNull(EndDate,'1900-01-01') As EndDate,
		IsFinish,
		CreateDate,
		CompanyId,
	IsNull((Select CompanyName From Company Where Id=p.CompanyId),'') As CompanyName,
		TypeId,
		IsNull((Select TrackKfAccount From [Order] Where OId=p.OrderId),'') As TrackKfAccount,
		(Select GenJinKfAccount From [Order] Where OId=p.OrderId) As GenJinKfAccount
		,isnull((select flag from Product where product.id=p.productid),0) as flag
	From Project_Task p
	Where TaskId=@TaskId
End